<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen 2.7.0" />

	<title>Class SMTP | nort</title>

	<script type="text/javascript" src="resources/combined.js?1481722677"></script>
	<script type="text/javascript" src="elementlist.js?1094816827"></script>
	<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?1567499433" />

</head>

<body>
<div id="left">
	<div id="menu">
		<a href="index.html" title="Overview"><span>Overview</span></a>


		<div id="groups">
			<h3>Packages</h3>
			<ul>
				<li><a href="package-App.html">App<span></span></a>
						<ul>
				<li><a href="package-App.Saas.html">Saas</a>
						</li>
				<li><a href="package-App.saas.html">saas</a>
						</li>
				<li><a href="package-App.SaaS.html">SaaS<span></span></a>
						<ul>
				<li><a href="package-App.saas.Logic.html">Logic</a>
						</li>
				<li><a href="package-App.SaaS.SaaS.html">SaaS</a>
						</li>
				<li><a href="package-App.Saas.Tables.html">Tables</a>
						</li>
				<li><a href="package-App.Saas.Vo.html">Vo</a>
						</li>
							</ul></li></ul></li>
				<li><a href="package-aqua.html">aqua<span></span></a>
						<ul>
				<li><a href="package-aqua.tools.html">tools<span></span></a>
						<ul>
				<li><a href="package-aqua.tools.Monitor.html">Monitor</a>
						</li>
							</ul></li></ul></li>
				<li><a href="package-flashservices.html">flashservices<span></span></a>
						<ul>
				<li><a href="package-flashservices.adapters.html">adapters</a>
						</li>
				<li><a href="package-flashservices.debug.html">debug</a>
						</li>
				<li><a href="package-flashservices.exception.html">exception</a>
						</li>
				<li><a href="package-flashservices.filters.html">filters</a>
						</li>
				<li><a href="package-flashservices.io.html">io</a>
						</li>
				<li><a href="package-flashservices.sql.html">sql</a>
						</li>
				<li><a href="package-flashservices.util.html">util</a>
						</li>
							</ul></li>
				<li><a href="package-Mekayotl.html">Mekayotl<span></span></a>
						<ul>
				<li><a href="package-Mekayotl.core.html">core</a>
						</li>
				<li><a href="package-Mekayotl.database.html">database<span></span></a>
						<ul>
				<li><a href="package-Mekayotl.database.dal.html">dal</a>
						</li>
				<li><a href="package-Mekayotl.database.mysql.html">mysql</a>
						</li>
				<li><a href="package-Mekayotl.database.sqlite.html">sqlite</a>
						</li>
							</ul></li>
				<li><a href="package-Mekayotl.tools.html">tools<span></span></a>
						<ul>
				<li><a href="package-Mekayotl.tools.render.html">render<span></span></a>
						<ul>
				<li><a href="package-Mekayotl.tools.render.html.html">html</a>
						</li>
							</ul></li>
				<li><a href="package-Mekayotl.tools.renders.html">renders</a>
						</li>
							</ul></li></ul></li>
				<li><a href="package-None.html">None</a>
						</li>
				<li><a href="package-PHP.html">PHP</a>
						</li>
				<li class="active"><a href="package-PHPMailer.html">PHPMailer</a>
						</li>
				<li><a href="package-Services.html">Services<span></span></a>
						<ul>
				<li><a href="package-Services.JSON.html">JSON</a>
						</li>
							</ul></li>
				<li><a href="package-Swift.html">Swift<span></span></a>
						<ul>
				<li><a href="package-Swift.ByteStream.html">ByteStream</a>
						</li>
				<li><a href="package-Swift.CharacterStream.html">CharacterStream</a>
						</li>
				<li><a href="package-Swift.Encoder.html">Encoder</a>
						</li>
				<li><a href="package-Swift.Events.html">Events</a>
						</li>
				<li><a href="package-Swift.KeyCache.html">KeyCache</a>
						</li>
				<li><a href="package-Swift.Mailer.html">Mailer</a>
						</li>
				<li><a href="package-Swift.Mime.html">Mime</a>
						</li>
				<li><a href="package-Swift.Plugins.html">Plugins</a>
						</li>
				<li><a href="package-Swift.Transport.html">Transport</a>
						</li>
							</ul></li>
			</ul>
		</div>

		<hr />


		<div id="elements">
			<h3>Classes</h3>
			<ul>
				<li><a href="class-POP3.html">POP3</a></li>
				<li class="active"><a href="class-SMTP.html">SMTP</a></li>
			</ul>





		</div>
	</div>
</div>

<div id="splitter"></div>

<div id="right">
<div id="rightInner">
	<form id="search">
		<input type="hidden" name="cx" value="" />
		<input type="hidden" name="ie" value="UTF-8" />
		<input type="text" name="q" class="text" />
		<input type="submit" value="Search" />
	</form>

	<div id="navigation">
		<ul>
			<li>
				<a href="index.html" title="Overview"><span>Overview</span></a>
			</li>
			<li>
				<a href="package-PHPMailer.html" title="Summary of PHPMailer"><span>Package</span></a>
			</li>
			<li class="active">
<span>Class</span>			</li>
		</ul>
		<ul>
			<li>
				<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
			</li>
		</ul>
		<ul>
		</ul>
	</div>

<div id="content" class="class">
	<h1>Class SMTP</h1>


	<div class="description">
	
<p>SMTP is rfc 821 compliant and implements all the rfc 821 SMTP commands except
TURN which will always return a not implemented error. SMTP also provides some
utility methods for sending mail to an SMTP server. original author: Chris
Ryan</p>

	</div>









	<div class="info">
		
		
		
		<b>Package:</b> <a href="package-PHPMailer.html">PHPMailer</a><br />

				<b>Copyright:</b>
				2004 - 2008 Andy Prevost<br />
				<b>License:</b>
				<a href="http://www.gnu.org/copyleft/lesser.html">Distributed under the Lesser General Public License (LGPL)</a><br />
				<b>Author:</b>
				Andy Prevost<br />
				<b>Author:</b>
				Marcus Bointon<br />
				<b>Used by:</b>
				<code><code><a href="class-PHPMailer.html#_">PHPMailer::SmtpSend()</a></code></code> <br />
				<b>Used by:</b>
				<code><code><a href="class-PHPMailer.html#_">PHPMailer::SmtpConnect()</a></code></code> <br />
		<b>Located at</b> <a href="source-class-SMTP.html#42" title="Go to source code">lib/php/externals/phpmailer/class.smtp.php</a><br />
	</div>


	<table class="summary" id="methods">
	<caption>Methods summary</caption>
	<tr data-order="__construct" id="___construct">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#___construct">#</a>
		<code><a href="source-class-SMTP.html#85" title="Go to source code">__construct</a>( )</code>

		<div class="description short">
			
<p>Initialize the class so that the data is in a known state.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Initialize the class so that the data is in a known state.</p>








		</div>
		</div></td>
	</tr>
	<tr data-order="Connect" id="_Connect">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Connect">#</a>
		<code><a href="source-class-SMTP.html#104" title="Go to source code">Connect</a>( <span> <var>$host</var></span>, <span> <var>$port</var> = <span class="php-num">0</span></span>, <span> <var>$tval</var> = <span class="php-num">30</span></span> )</code>

		<div class="description short">
			
<p>Connect to the server specified on the port specified. If the port is not
specified use the default SMTP_PORT. If tval is specified then a connection will
try and be established with the server for that number of seconds. If tval is
not specified the default is 30 seconds to try on the connection.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Connect to the server specified on the port specified. If the port is not
specified use the default SMTP_PORT. If tval is specified then a connection will
try and be established with the server for that number of seconds. If tval is
not specified the default is 30 seconds to try on the connection.</p>

<p>SMTP CODE SUCCESS: 220 SMTP CODE FAILURE: 421</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="StartTLS" id="_StartTLS">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_StartTLS">#</a>
		<code><a href="source-class-SMTP.html#171" title="Go to source code">StartTLS</a>( )</code>

		<div class="description short">
			
<p>Initiate a TLS communication with the server.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Initiate a TLS communication with the server.</p>

<p>SMTP CODE 220 Ready to start TLS SMTP CODE 501 Syntax error (no parameters
allowed) SMTP CODE 454 TLS not available due to temporary reason</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br>success<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="Authenticate" id="_Authenticate">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Authenticate">#</a>
		<code><a href="source-class-SMTP.html#223" title="Go to source code">Authenticate</a>( <span> <var>$username</var></span>, <span> <var>$password</var></span> )</code>

		<div class="description short">
			
<p>Performs SMTP authentication. Must be run after running the Hello() method.
Returns TRUE if successfully authenticated.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Performs SMTP authentication. Must be run after running the Hello() method.
Returns TRUE if successfully authenticated.</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="Connected" id="_Connected">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Connected">#</a>
		<code><a href="source-class-SMTP.html#292" title="Go to source code">Connected</a>( )</code>

		<div class="description short">
			
<p>Returns TRUE if connected to a server otherwise FALSE</p>

		</div>

		<div class="description detailed hidden">
			
<p>Returns TRUE if connected to a server otherwise FALSE</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="Close" id="_Close">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Close">#</a>
		<code><a href="source-class-SMTP.html#316" title="Go to source code">Close</a>( )</code>

		<div class="description short">
			
<p>Closes the socket and cleans up the state of the class. It is not considered
good to use this function without first trying to use QUIT.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Closes the socket and cleans up the state of the class. It is not considered
good to use this function without first trying to use QUIT.</p>








		</div>
		</div></td>
	</tr>
	<tr data-order="Data" id="_Data">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Data">#</a>
		<code><a href="source-class-SMTP.html#339" title="Go to source code">Data</a>( <span> <var>$msg_data</var></span> )</code>

		<div class="description short">
			
<p>Issues a data command and sends the msg_data to the server finializing the
mail transaction. $msg_data is the message that is to be send with the headers.
Each header needs to be on a single line followed by a &lt;CRLF&gt; with the
message headers and the message body being seperated by and additional
&lt;CRLF&gt;.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Issues a data command and sends the msg_data to the server finializing the
mail transaction. $msg_data is the message that is to be send with the headers.
Each header needs to be on a single line followed by a &lt;CRLF&gt; with the
message headers and the message body being seperated by and additional
&lt;CRLF&gt;.</p>

<p>Implements rfc 821: DATA &lt;CRLF&gt;</p>

<p>SMTP CODE INTERMEDIATE: 354 [data] &lt;CRLF&gt;.&lt;CRLF&gt; SMTP CODE
SUCCESS: 250 SMTP CODE FAILURE: 552,554,451,452 SMTP CODE FAILURE: 451,554 SMTP
CODE ERROR : 500,501,503,421</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="Hello" id="_Hello">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Hello">#</a>
		<code><a href="source-class-SMTP.html#489" title="Go to source code">Hello</a>( <span> <var>$host</var> = <span class="php-quote">''</span></span> )</code>

		<div class="description short">
			
<p>Sends the HELO command to the smtp server. This makes sure that we and the
server are in the same known state.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Sends the HELO command to the smtp server. This makes sure that we and the
server are in the same known state.</p>

<p>Implements from rfc 821: HELO &lt;SP&gt; &lt;domain&gt; &lt;CRLF&gt;</p>

<p>SMTP CODE SUCCESS: 250 SMTP CODE ERROR : 500, 501, 504, 421</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="Mail" id="_Mail">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Mail">#</a>
		<code><a href="source-class-SMTP.html#564" title="Go to source code">Mail</a>( <span> <var>$from</var></span> )</code>

		<div class="description short">
			
<p>Starts a mail transaction from the email address specified in $from. Returns
TRUE if successful or FALSE otherwise. If True the mail transaction is started
and then one or more Recipient commands may be called followed by a Data
command.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Starts a mail transaction from the email address specified in $from. Returns
TRUE if successful or FALSE otherwise. If True the mail transaction is started
and then one or more Recipient commands may be called followed by a Data
command.</p>

<p>Implements rfc 821: MAIL &lt;SP&gt; FROM:&lt;reverse-path&gt;
&lt;CRLF&gt;</p>

<p>SMTP CODE SUCCESS: 250 SMTP CODE SUCCESS: 552,451,452 SMTP CODE SUCCESS:
500,501,421</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="Quit" id="_Quit">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Quit">#</a>
		<code><a href="source-class-SMTP.html#616" title="Go to source code">Quit</a>( <span> <var>$close_on_error</var> = <span class="php-keyword1">TRUE</span></span> )</code>

		<div class="description short">
			
<p>Sends the quit command to the server and then closes the socket if there is
no error or the $close_on_error argument is TRUE.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Sends the quit command to the server and then closes the socket if there is
no error or the $close_on_error argument is TRUE.</p>

<p>Implements from rfc 821: QUIT &lt;CRLF&gt;</p>

<p>SMTP CODE SUCCESS: 221 SMTP CODE ERROR : 500</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="Recipient" id="_Recipient">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Recipient">#</a>
		<code><a href="source-class-SMTP.html#674" title="Go to source code">Recipient</a>( <span> <var>$to</var></span> )</code>

		<div class="description short">
			
<p>Sends the command RCPT to the SMTP server with the TO: argument of $to.
Returns TRUE if the recipient was accepted FALSE if it was rejected.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Sends the command RCPT to the SMTP server with the TO: argument of $to.
Returns TRUE if the recipient was accepted FALSE if it was rejected.</p>

<p>Implements from rfc 821: RCPT &lt;SP&gt; TO:&lt;forward-path&gt;
&lt;CRLF&gt;</p>

<p>SMTP CODE SUCCESS: 250,251 SMTP CODE FAILURE: 550,551,552,553,450,451,452
SMTP CODE ERROR : 500,501,503,421</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="Reset" id="_Reset">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Reset">#</a>
		<code><a href="source-class-SMTP.html#722" title="Go to source code">Reset</a>( )</code>

		<div class="description short">
			
<p>Sends the RSET command to abort and transaction that is currently in
progress. Returns TRUE if successful FALSE otherwise.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Sends the RSET command to abort and transaction that is currently in
progress. Returns TRUE if successful FALSE otherwise.</p>

<p>Implements rfc 821: RSET &lt;CRLF&gt;</p>

<p>SMTP CODE SUCCESS: 250 SMTP CODE ERROR : 500,501,504,421</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="SendAndMail" id="_SendAndMail">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_SendAndMail">#</a>
		<code><a href="source-class-SMTP.html#771" title="Go to source code">SendAndMail</a>( <span> <var>$from</var></span> )</code>

		<div class="description short">
			
<p>Starts a mail transaction from the email address specified in $from. Returns
TRUE if successful or FALSE otherwise. If True the mail transaction is started
and then one or more Recipient commands may be called followed by a Data
command. This command will send the message to the users terminal if they are
logged in and send them an email.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Starts a mail transaction from the email address specified in $from. Returns
TRUE if successful or FALSE otherwise. If True the mail transaction is started
and then one or more Recipient commands may be called followed by a Data
command. This command will send the message to the users terminal if they are
logged in and send them an email.</p>

<p>Implements rfc 821: SAML &lt;SP&gt; FROM:&lt;reverse-path&gt;
&lt;CRLF&gt;</p>

<p>SMTP CODE SUCCESS: 250 SMTP CODE SUCCESS: 552,451,452 SMTP CODE SUCCESS:
500,501,502,421</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="Turn" id="_Turn">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Turn">#</a>
		<code><a href="source-class-SMTP.html#823" title="Go to source code">Turn</a>( )</code>

		<div class="description short">
			
<p>This is an optional command for SMTP that this class does not support. This
method is here to make the RFC821 Definition complete for this class and __may__
be implimented in the future</p>

		</div>

		<div class="description detailed hidden">
			
<p>This is an optional command for SMTP that this class does not support. This
method is here to make the RFC821 Definition complete for this class and __may__
be implimented in the future</p>

<p>Implements from rfc 821: TURN &lt;CRLF&gt;</p>

<p>SMTP CODE SUCCESS: 250 SMTP CODE FAILURE: 502 SMTP CODE ERROR : 500, 503</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="getError" id="_getError">

		<td class="attributes"><code>
			 public 
			array
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_getError">#</a>
		<code><a href="source-class-SMTP.html#850" title="Go to source code">getError</a>( )</code>

		<div class="description short">
			
<p>Get the current error</p>

		</div>

		<div class="description detailed hidden">
			
<p>Get the current error</p>




				<h4>Returns</h4>
				<div class="list">
					<code>array</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	</table>







	<table class="summary" id="properties">
	<caption>Properties summary</caption>
	<tr data-order="SMTP_PORT" id="$SMTP_PORT">

		<td class="attributes"><code>
			public 
			integer
		</code></td>

		<td class="name">
				<a href="source-class-SMTP.html#52" title="Go to source code"><var>$SMTP_PORT</var></a>
		</td>
		<td class="value"><code><span class="php-num">25</span></code></td>
		<td class="description"><div>
			<a href="#$SMTP_PORT" class="anchor">#</a>

			<div class="description short">
				
<p>SMTP server port</p>

			</div>

			<div class="description detailed hidden">
				
<p>SMTP server port</p>


			</div>
		</div></td>
	</tr>
	<tr data-order="CRLF" id="$CRLF">

		<td class="attributes"><code>
			public 
			string
		</code></td>

		<td class="name">
				<a href="source-class-SMTP.html#58" title="Go to source code"><var>$CRLF</var></a>
		</td>
		<td class="value"><code><span class="php-quote">&quot;\r\n&quot;</span></code></td>
		<td class="description"><div>
			<a href="#$CRLF" class="anchor">#</a>

			<div class="description short">
				
<p>SMTP reply line ending</p>

			</div>

			<div class="description detailed hidden">
				
<p>SMTP reply line ending</p>


			</div>
		</div></td>
	</tr>
	<tr data-order="do_debug" id="$do_debug">

		<td class="attributes"><code>
			public 
			boolean
		</code></td>

		<td class="name">
				<a href="source-class-SMTP.html#64" title="Go to source code"><var>$do_debug</var></a>
		</td>
		<td class="value"><code></code></td>
		<td class="description"><div>
			<a href="#$do_debug" class="anchor">#</a>

			<div class="description short">
				
<p>Sets whether debugging is turned on</p>

			</div>

			<div class="description detailed hidden">
				
<p>Sets whether debugging is turned on</p>


			</div>
		</div></td>
	</tr>
	<tr data-order="do_verp" id="$do_verp">

		<td class="attributes"><code>
			public 
			boolean
		</code></td>

		<td class="name">
				<a href="source-class-SMTP.html#70" title="Go to source code"><var>$do_verp</var></a>
		</td>
		<td class="value"><code><span class="php-keyword1">FALSE</span></code></td>
		<td class="description"><div>
			<a href="#$do_verp" class="anchor">#</a>

			<div class="description short">
				
<p>Sets VERP use on/off (default is off)</p>

			</div>

			<div class="description detailed hidden">
				
<p>Sets VERP use on/off (default is off)</p>


			</div>
		</div></td>
	</tr>
	</table>



</div>

	<div id="footer">
		nort API documentation generated by <a href="http://apigen.org">ApiGen 2.7.0</a>
	</div>
</div>
</div>
</body>
</html>
